package com.example.mtblog.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
@Data
public class UserInfo {


    private Integer uid;
    private String friends;

    //lik
    private String userLikeArticleIds;        //用户喜欢的文章ID
    private  Integer userLikeArticleNum;      //喜欢文章数量
    private  Integer userLikeArticleNumLimt;  //喜欢文章上限

    //collect
    private String userCollectArticleIds;        //用户收藏的文章ID
    private  Integer userCollectArticleNum;      //收藏文章数量
    private  Integer userCollectArticleNumLimt;  //收藏文章上限

    public void init(UserInfo userInfo){

        userInfo.userLikeArticleNum = 0;
        userInfo.userCollectArticleNum = 0;
        userInfo.userLikeArticleNumLimt = 100;
        userInfo.userCollectArticleNumLimt = 100;
    }

    public UserInfo export(UserInfo userInfo){
        UserInfo userInfo1 = new UserInfo();
        userInfo1.setUserCollectArticleNum(userInfo.getUserCollectArticleNum());
        userInfo1.setUserLikeArticleNum(userInfo.getUserLikeArticleNum());
        return userInfo1;
    }
}


